﻿//------------------------------------------------------------------------------
// <copyright file="Assessment.cs" company="David Martos">
//     Copyright (c) David Martos.  All rights reserved.
// </copyright>
// <summary>Partial class for the model used to add the metadata</summary>
//  ----------------------------------------------------------------------------
namespace Dissemination.MVC.Models
{
    #region Using statements

    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Web.Mvc;

    #endregion

    /// <summary>
    /// Partial class for the model used to add the metadata
    /// </summary>
    [MetadataType(typeof(SurveyMetaData))]
    public partial class Survey
    {
        [DisplayName("Name")]
        public string SurveyFriendlyName
        {
            get
            {
                return this.SurveyPeriod + " " + this.SurveyYear;
            }
        }

        /// <summary>
        /// Metadata class for the model
        /// </summary>
        [Bind(Exclude = "SurveyID")]
        public class SurveyMetaData
        {
            [Required(ErrorMessage = "The period is required")]
            [DisplayName("Period")]
            [StringLength(256)]
            public string SurveyPeriod { get; set; }

            [DisplayName("Year")]
            public int SurveyYear { get; set; }

            [DisplayName("Ordinal")]
            public int SurveyOrdinal { get; set; }
        }
    }
}